home *** CD-ROM | disk | FTP | other *** search
MacBinary | 2002-03-15 | 8.0 KB | [TEXT/Pyth] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
1%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, Fri Mar 15 11:28:02 2002, modified Fri Mar 15 11:28:02 2002, creator 'Pyth', type ASCII, 7641 bytes "dlgTk.py" , at 0x1e59 286 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| dearkID
| deark: macbinary
| default
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
| |
100%
| librempegprobeID
| NGC (Nintendo DSP Standard) (ngcdspstd)
| default (weak)
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [Pyth] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 64 6c 67 54 6b 2e | 70 79 00 00 00 00 00 00 |..dlgTk.|py......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 50 79 74 | 68 00 00 00 00 00 00 00 |.TEXTPyt|h.......|
|00000050| 00 00 00 00 00 1d d9 00 | 00 01 1e b8 b7 d1 92 b8 |........|........|
|00000060| b7 d1 92 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 98 2b 00 00 |........|.....+..|
|00000080| 0d 66 72 6f 6d 20 54 6b | 69 6e 74 65 72 20 69 6d |.from Tk|inter im|
|00000090| 70 6f 72 74 20 2a 0d 69 | 6d 70 6f 72 74 20 61 74 |port *.i|mport at|
|000000a0| 68 65 6e 61 54 4b 0d 0d | 66 6f 6e 74 54 69 74 6c |henaTK..|fontTitl|
|000000b0| 65 20 3d 20 61 74 68 65 | 6e 61 54 4b 2e 66 6f 6e |e = athe|naTK.fon|
|000000c0| 74 54 69 74 6c 65 0d 66 | 6f 6e 74 54 65 78 74 20 |tTitle.f|ontText |
|000000d0| 20 3d 20 61 74 68 65 6e | 61 54 4b 2e 66 6f 6e 74 | = athen|aTK.font|
|000000e0| 54 65 78 74 0d 0d 43 4f | 4c 4f 52 62 67 31 20 3d |Text..CO|LORbg1 =|
|000000f0| 20 61 74 68 65 6e 61 54 | 4b 2e 43 4f 4c 4f 52 62 | athenaT|K.COLORb|
|00000100| 67 31 20 23 67 72 65 79 | 3a 20 67 72 6f 75 70 20 |g1 #grey|: group |
|00000110| 28 6d 65 74 61 2d 72 6f | 77 29 20 6c 61 62 65 6c |(meta-ro|w) label|
|00000120| 0d 43 4f 4c 4f 52 62 67 | 32 20 3d 20 61 74 68 65 |.COLORbg|2 = athe|
|00000130| 6e 61 54 4b 2e 43 4f 4c | 4f 52 62 67 32 20 23 61 |naTK.COL|ORbg2 #a|
|00000140| 6c 6d 6f 73 74 2d 62 6c | 61 63 6b 3a 20 67 65 6e |lmost-bl|ack: gen|
|00000150| 65 72 61 6c 2d 62 6b 67 | 0d 43 4f 4c 4f 52 62 67 |eral-bkg|.COLORbg|
|00000160| 33 20 3d 20 61 74 68 65 | 6e 61 54 4b 2e 43 4f 4c |3 = athe|naTK.COL|
|00000170| 4f 52 62 67 33 20 23 67 | 72 65 79 3a 20 73 69 6e |ORbg3 #g|rey: sin|
|00000180| 67 6c 65 2d 6c 69 6e 65 | 2c 20 62 72 69 67 68 74 |gle-line|, bright|
|00000190| 65 73 74 20 63 6f 6c 6f | 72 0d 43 4f 4c 4f 52 62 |est colo|r.COLORb|
|000001a0| 67 34 20 3d 20 61 74 68 | 65 6e 61 54 4b 2e 43 4f |g4 = ath|enaTK.CO|
|000001b0| 4c 4f 52 62 67 34 20 23 | 67 72 65 79 3a 20 72 6f |LORbg4 #|grey: ro|
|000001c0| 77 2d 6c 65 76 65 6c 20 | 6c 61 62 65 6c 20 0d 43 |w-level |label .C|
|000001d0| 4f 4c 4f 52 62 67 35 20 | 3d 20 61 74 68 65 6e 61 |OLORbg5 |= athena|
|000001e0| 54 4b 2e 43 4f 4c 4f 52 | 62 67 35 20 23 20 64 61 |TK.COLOR|bg5 # da|
|000001f0| 72 6b 65 72 20 74 68 61 | 6e 20 62 67 32 0d 0d 43 |rker tha|n bg2..C|
|00000200| 4f 4c 4f 52 74 78 31 20 | 3d 20 61 74 68 65 6e 61 |OLORtx1 |= athena|
|00000210| 54 4b 2e 43 4f 4c 4f 52 | 74 78 31 20 23 67 72 65 |TK.COLOR|tx1 #gre|
|00000220| 79 3a 20 67 72 6f 75 70 | 20 28 6d 65 74 61 2d 72 |y: group| (meta-r|
|00000230| 6f 77 29 20 74 65 78 74 | 0d 43 4f 4c 4f 52 74 78 |ow) text|.COLORtx|
|00000240| 32 20 3d 20 61 74 68 65 | 6e 61 54 4b 2e 43 4f 4c |2 = athe|naTK.COL|
|00000250| 4f 52 74 78 32 20 23 67 | 72 65 79 3a 20 72 6f 77 |ORtx2 #g|rey: row|
|00000260| 2d 6c 65 76 65 6c 20 74 | 65 78 74 0d 43 4f 4c 4f |-level t|ext.COLO|
|00000270| 52 74 78 33 20 3d 20 61 | 74 68 65 6e 61 54 4b 2e |Rtx3 = a|thenaTK.|
|00000280| 43 4f 4c 4f 52 74 78 33 | 20 23 64 61 72 6b 2d 72 |COLORtx3| #dark-r|
|00000290| 6f 73 65 3a 20 62 75 74 | 74 6f 6e 2d 6c 61 62 65 |ose: but|ton-labe|
|000002a0| 6c 20 74 65 78 74 0d 0d | 57 49 4e 6d 69 6e 58 20 |l text..|WINminX |
|000002b0| 20 20 20 3d 20 61 74 68 | 65 6e 61 54 4b 2e 57 49 | = ath|enaTK.WI|
|000002c0| 4e 6d 69 6e 58 0d 57 49 | 4e 6d 69 6e 59 20 20 20 |NminX.WI|NminY |
|000002d0| 20 3d 20 37 32 0d 0d 63 | 6c 61 73 73 20 44 69 61 | = 72..c|lass Dia|
|000002e0| 6c 6f 67 28 54 6f 70 6c | 65 76 65 6c 29 3a 0d 20 |log(Topl|evel):. |
|000002f0| 20 20 27 27 27 43 6c 61 | 73 73 20 74 6f 20 6f 70 | '''Cla|ss to op|
|00000300| 65 6e 20 64 69 61 6c 6f | 67 73 2e 0d 20 20 20 54 |en dialo|gs.. T|
|00000310| 68 69 73 20 63 6c 61 73 | 73 20 69 73 20 69 6e 74 |his clas|s is int|
|00000320| 65 6e 64 65 64 20 61 73 | 20 61 20 62 61 73 65 20 |ended as| a base |
|00000330| 63 6c 61 73 73 20 66 6f | 72 20 63 75 73 74 6f 6d |class fo|r custom|
|00000340| 20 64 69 61 6c 6f 67 73 | 0d 20 20 20 27 27 27 0d | dialogs|. '''.|
|00000350| 20 20 20 64 65 66 20 5f | 5f 69 6e 69 74 5f 5f 28 | def _|_init__(|
|00000360| 73 65 6c 66 2c 20 70 61 | 72 65 6e 74 2c 20 74 69 |self, pa|rent, ti|
|00000370| 74 6c 65 3d 4e 6f 6e 65 | 29 3a 0d 20 20 20 20 20 |tle=None|):. |
|00000380| 20 27 27 27 49 6e 69 74 | 69 61 6c 69 7a 65 20 61 | '''Init|ialize a|
|00000390| 20 64 69 61 6c 6f 67 2e | 0d 20 20 20 20 20 20 41 | dialog.|. A|
|000003a0| 72 67 75 6d 65 6e 74 73 | 3a 0d 20 20 20 20 20 20 |rguments|:. |
|000003b0| 20 20 20 70 61 72 65 6e | 74 20 2d 2d 20 61 20 70 | paren|t -- a p|
|000003c0| 61 72 65 6e 74 20 77 69 | 6e 64 6f 77 20 28 74 68 |arent wi|ndow (th|
|000003d0| 65 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 20 77 69 |e applic|ation wi|
|000003e0| 6e 64 6f 77 29 0d 20 20 | 20 20 20 20 20 20 20 74 |ndow). | t|
|000003f0| 69 74 6c 65 20 2d 2d 20 | 74 68 65 20 64 69 61 6c |itle -- |the dial|
|00000400| 6f 67 20 74 69 74 6c 65 | 0d 20 20 20 20 20 20 27 |og title|. '|
|00000410| 27 27 0d 20 20 20 20 20 | 20 54 6f 70 6c 65 76 65 |''. | Topleve|
|00000420| 6c 2e 5f 5f 69 6e 69 74 | 5f 5f 28 73 65 6c 66 2c |l.__init|__(self,|
|00000430| 20 70 61 72 65 6e 74 2c | 20 62 67 3d 43 4f 4c 4f | parent,| bg=COLO|
|00000440| 52 62 67 32 29 0d 20 20 | 20 20 20 20 23 20 73 65 |Rbg2). | # se|
|00000450| 6c 66 2e 74 72 61 6e 73 | 69 65 6e 74 28 70 61 72 |lf.trans|ient(par|
|00000460| 65 6e 74 29 20 74 68 69 | 73 20 6d 61 6b 65 73 20 |ent) thi|s makes |
|00000470| 61 20 77 69 6e 64 6f 77 | 20 77 2f 6f 20 61 20 66 |a window| w/o a f|
|00000480| 72 61 6d 65 0d 0d 20 20 | 20 20 20 20 69 66 20 74 |rame.. | if t|
|00000490| 69 74 6c 65 3a 0d 20 20 | 20 20 20 20 20 20 20 73 |itle:. | s|
|000004a0| 65 6c 66 2e 74 69 74 6c | 65 28 74 69 74 6c 65 29 |elf.titl|e(title)|
|000004b0| 0d 20 20 20 20 20 20 73 | 65 6c 66 2e 70 61 72 65 |. s|elf.pare|
|000004c0| 6e 74 20 3d 20 70 61 72 | 65 6e 74 0d 20 20 20 20 |nt = par|ent. |
|000004d0| 20 20 73 65 6c 66 2e 72 | 65 73 75 6c 74 20 3d 20 | self.r|esult = |
|000004e0| 4e 6f 6e 65 0d 0d 20 20 | 20 20 20 20 62 6f 64 79 |None.. | body|
|000004f0| 20 3d 20 46 72 61 6d 65 | 28 73 65 6c 66 2c 20 62 | = Frame|(self, b|
|00000500| 67 3d 43 4f 4c 4f 52 62 | 67 32 29 0d 20 20 20 20 |g=COLORb|g2). |
|00000510| 20 20 73 65 6c 66 2e 69 | 6e 69 74 69 61 6c 5f 66 | self.i|nitial_f|
|00000520| 6f 63 75 73 20 3d 20 73 | 65 6c 66 2e 62 6f 64 79 |ocus = s|elf.body|
|00000530| 28 62 6f 64 79 29 0d 20 | 20 20 20 20 20 62 6f 64 |(body). | bod|
|00000540| 79 2e 70 61 63 6b 28 70 | 61 64 78 3d 30 2c 20 70 |y.pack(p|adx=0, p|
|00000550| 61 64 79 3d 30 2c 20 65 | 78 70 61 6e 64 3d 31 29 |ady=0, e|xpand=1)|
|00000560| 0d 0d 20 20 20 20 20 20 | 73 65 6c 66 2e 62 75 74 |.. |self.but|
|00000570| 74 6f 6e 62 6f 78 28 29 | 0d 20 20 20 20 20 20 73 |tonbox()|. s|
|00000580| 65 6c 66 2e 67 72 61 62 | 5f 73 65 74 28 29 0d 0d |elf.grab|_set()..|
|00000590| 20 20 20 20 20 20 69 66 | 20 6e 6f 74 20 73 65 6c | if| not sel|
|000005a0| 66 2e 69 6e 69 74 69 61 | 6c 5f 66 6f 63 75 73 3a |f.initia|l_focus:|
|000005b0| 0d 20 20 20 20 20 20 20 | 20 20 73 65 6c 66 2e 69 |. | self.i|
|000005c0| 6e 69 74 69 61 6c 5f 66 | 6f 63 75 73 20 3d 20 73 |nitial_f|ocus = s|
|000005d0| 65 6c 66 0d 0d 20 20 20 | 20 20 20 73 65 6c 66 2e |elf.. | self.|
|000005e0| 70 72 6f 74 6f 63 6f 6c | 28 22 57 4d 5f 44 45 4c |protocol|("WM_DEL|
|000005f0| 45 54 45 5f 57 49 4e 44 | 4f 57 22 2c 20 73 65 6c |ETE_WIND|OW", sel|
|00000600| 66 2e 63 61 6e 63 65 6c | 29 0d 20 20 20 20 20 20 |f.cancel|). |
|00000610| 69 66 20 73 65 6c 66 2e | 70 61 72 65 6e 74 20 69 |if self.|parent i|
|00000620| 73 20 6e 6f 74 20 4e 6f | 6e 65 3a 0d 20 20 20 20 |s not No|ne:. |
|00000630| 20 20 20 20 20 73 65 6c | 66 2e 67 65 6f 6d 65 74 | sel|f.geomet|
|00000640| 72 79 28 22 25 64 78 25 | 64 2b 25 64 2b 25 64 22 |ry("%dx%|d+%d+%d"|
|00000650| 20 25 20 28 57 49 4e 6d | 69 6e 58 2c 20 57 49 4e | % (WINm|inX, WIN|
|00000660| 6d 69 6e 59 2c 20 70 61 | 72 65 6e 74 2e 77 69 6e |minY, pa|rent.win|
|00000670| 66 6f 5f 72 6f 6f 74 78 | 28 29 2b 30 2c 0d 20 20 |fo_rootx|()+0,. |
|00000680| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000690| 20 20 20 20 20 20 20 20 | 20 20 20 70 61 72 65 6e | | paren|
|000006a0| 74 2e 77 69 6e 66 6f 5f | 72 6f 6f 74 79 28 29 2b |t.winfo_|rooty()+|
|000006b0| 30 29 29 0d 20 20 20 20 | 20 20 73 65 6c 66 2e 6d |0)). | self.m|
|000006c0| 61 78 73 69 7a 65 28 77 | 69 64 74 68 3d 57 49 4e |axsize(w|idth=WIN|
|000006d0| 6d 69 6e 58 2c 20 68 65 | 69 67 68 74 3d 57 49 4e |minX, he|ight=WIN|
|000006e0| 6d 69 6e 59 29 0d 20 20 | 20 20 20 20 73 65 6c 66 |minY). | self|
|000006f0| 2e 6d 69 6e 73 69 7a 65 | 28 77 69 64 74 68 3d 57 |.minsize|(width=W|
|00000700| 49 4e 6d 69 6e 58 2c 20 | 68 65 69 67 68 74 3d 57 |INminX, |height=W|
|00000710| 49 4e 6d 69 6e 59 29 0d | 0d 20 20 20 20 20 20 73 |INminY).|. s|
|00000720| 65 6c 66 2e 69 6e 69 74 | 69 61 6c 5f 66 6f 63 75 |elf.init|ial_focu|
|00000730| 73 2e 66 6f 63 75 73 5f | 73 65 74 28 29 0d 20 20 |s.focus_|set(). |
|00000740| 20 20 20 20 73 65 6c 66 | 2e 77 61 69 74 5f 77 69 | self|.wait_wi|
|00000750| 6e 64 6f 77 28 73 65 6c | 66 29 0d 0d 20 20 20 64 |ndow(sel|f).. d|
|00000760| 65 66 20 64 65 73 74 72 | 6f 79 28 73 65 6c 66 29 |ef destr|oy(self)|
|00000770| 3a 0d 20 20 20 20 20 20 | 27 27 27 44 65 73 74 72 |:. |'''Destr|
|00000780| 6f 79 20 74 68 65 20 77 | 69 6e 64 6f 77 27 27 27 |oy the w|indow'''|
|00000790| 0d 20 20 20 20 20 20 73 | 65 6c 66 2e 69 6e 69 74 |. s|elf.init|
|000007a0| 69 61 6c 5f 66 6f 63 75 | 73 20 3d 20 4e 6f 6e 65 |ial_focu|s = None|
|000007b0| 0d 20 20 20 20 20 20 54 | 6f 70 6c 65 76 65 6c 2e |. T|oplevel.|
|000007c0| 64 65 73 74 72 6f 79 28 | 73 65 6c 66 29 0d 0d 20 |destroy(|self).. |
|000007d0| 20 20 64 65 66 20 62 6f | 64 79 28 73 65 6c 66 2c | def bo|dy(self,|
|000007e0| 20 6d 61 73 74 65 72 29 | 3a 0d 20 20 20 20 20 20 | master)|:. |
|000007f0| 70 61 73 73 20 23 20 6f | 76 65 72 72 69 64 65 0d |pass # o|verride.|
|00000800| 0d 20 20 20 64 65 66 20 | 62 75 74 74 6f 6e 62 6f |. def |buttonbo|
|00000810| 78 28 73 65 6c 66 29 3a | 0d 20 20 20 20 20 20 27 |x(self):|. '|
|00000820| 27 27 61 64 64 20 73 74 | 61 6e 64 61 72 64 20 62 |''add st|andard b|
|00000830| 75 74 74 6f 6e 20 62 6f | 78 2e 0d 20 20 20 20 20 |utton bo|x.. |
|00000840| 20 6f 76 65 72 72 69 64 | 65 20 69 66 20 79 6f 75 | overrid|e if you|
|00000850| 20 64 6f 20 6e 6f 74 20 | 77 61 6e 74 20 74 68 65 | do not |want the|
|00000860| 20 73 74 61 6e 64 61 72 | 64 20 62 75 74 74 6f 6e | standar|d button|
|00000870| 73 0d 20 20 20 20 20 20 | 27 27 27 0d 20 20 20 20 |s. |'''. |
|00000880| 20 20 62 6f 78 20 3d 20 | 46 72 61 6d 65 28 73 65 | box = |Frame(se|
|00000890| 6c 66 2c 20 62 67 3d 43 | 4f 4c 4f 52 62 67 32 2c |lf, bg=C|OLORbg2,|
|000008a0| 20 62 64 3d 30 29 0d 0d | 20 20 20 20 20 20 64 69 | bd=0)..| di|
|000008b0| 76 5f 72 6f 77 20 3d 20 | 46 72 61 6d 65 28 62 6f |v_row = |Frame(bo|
|000008c0| 78 2c 20 62 67 3d 43 4f | 4c 4f 52 62 67 31 29 0d |x, bg=CO|LORbg1).|
|000008d0| 20 20 20 20 20 20 61 74 | 68 65 6e 61 54 4b 2e 42 | at|henaTK.B|
|000008e0| 6c 61 6e 6b 46 72 61 6d | 65 28 64 69 76 5f 72 6f |lankFram|e(div_ro|
|000008f0| 77 29 20 20 23 67 72 61 | 79 0d 20 20 20 20 20 20 |w) #gra|y. |
|00000900| 64 69 76 5f 72 6f 77 2e | 70 61 63 6b 28 73 69 64 |div_row.|pack(sid|
|00000910| 65 3d 54 4f 50 2c 20 65 | 78 70 61 6e 64 3d 31 2c |e=TOP, e|xpand=1,|
|00000920| 20 66 69 6c 6c 3d 42 4f | 54 48 29 20 0d 0d 20 20 | fill=BO|TH) .. |
|00000930| 20 20 20 20 64 69 76 5f | 72 6f 77 20 3d 20 46 72 | div_|row = Fr|
|00000940| 61 6d 65 28 62 6f 78 2c | 20 62 67 3d 43 4f 4c 4f |ame(box,| bg=COLO|
|00000950| 52 62 67 31 29 0d 20 20 | 20 20 20 20 61 74 68 65 |Rbg1). | athe|
|00000960| 6e 61 54 4b 2e 42 6c 61 | 6e 6b 46 72 61 6d 65 32 |naTK.Bla|nkFrame2|
|00000970| 28 64 69 76 5f 72 6f 77 | 29 20 20 23 62 6c 61 63 |(div_row|) #blac|
|00000980| 6b 0d 20 20 20 20 20 20 | 64 69 76 5f 72 6f 77 2e |k. |div_row.|
|00000990| 70 61 63 6b 28 73 69 64 | 65 3d 54 4f 50 2c 20 65 |pack(sid|e=TOP, e|
|000009a0| 78 70 61 6e 64 3d 31 2c | 20 66 69 6c 6c 3d 42 4f |xpand=1,| fill=BO|
|000009b0| 54 48 29 0d 0d 20 20 20 | 20 20 20 61 74 68 65 6e |TH).. | athen|
|000009c0| 61 54 4b 2e 53 78 4c 61 | 62 65 6c 28 62 6f 78 2c |aTK.SxLa|bel(box,|
|000009d0| 20 27 6f 6b 27 2c 20 20 | 20 20 20 27 6f 6b 27 2c | 'ok', | 'ok',|
|000009e0| 20 27 27 2c 20 31 30 29 | 20 23 20 73 65 74 73 20 | '', 10)| # sets |
|000009f0| 77 69 64 74 68 0d 20 20 | 20 20 20 20 61 74 68 65 |width. | athe|
|00000a00| 6e 61 54 4b 2e 53 78 4c | 61 62 65 6c 28 62 6f 78 |naTK.SxL|abel(box|
|00000a10| 2c 20 27 63 61 6e 63 65 | 6c 27 2c 20 27 63 61 6e |, 'cance|l', 'can|
|00000a20| 63 65 6c 27 2c 20 27 27 | 2c 20 31 30 29 0d 0d 20 |cel', ''|, 10).. |
|00000a30| 20 20 20 20 20 23 77 20 | 3d 20 42 75 74 74 6f 6e | #w |= Button|
|00000a40| 28 62 6f 78 2c 20 74 65 | 78 74 3d 22 4f 4b 22 2c |(box, te|xt="OK",|
|00000a50| 20 66 6f 6e 74 3d 66 6f | 6e 74 54 69 74 6c 65 2c | font=fo|ntTitle,|
|00000a60| 20 77 69 64 74 68 3d 31 | 30 2c 20 63 6f 6d 6d 61 | width=1|0, comma|
|00000a70| 6e 64 3d 73 65 6c 66 2e | 6f 6b 2c 29 0d 20 20 20 |nd=self.|ok,). |
|00000a80| 20 20 20 23 77 2e 70 61 | 63 6b 28 73 69 64 65 3d | #w.pa|ck(side=|
|00000a90| 4c 45 46 54 2c 20 70 61 | 64 78 3d 31 2c 20 70 61 |LEFT, pa|dx=1, pa|
|00000aa0| 64 79 3d 31 29 0d 20 20 | 20 20 20 20 73 65 6c 66 |dy=1). | self|
|00000ab0| 2e 62 69 6e 64 28 22 3c | 52 65 74 75 72 6e 3e 22 |.bind("<|Return>"|
|00000ac0| 2c 20 73 65 6c 66 2e 6f | 6b 29 0d 20 20 20 20 20 |, self.o|k). |
|00000ad0| 20 73 65 6c 66 2e 62 69 | 6e 64 28 22 3c 45 73 63 | self.bi|nd("<Esc|
|00000ae0| 61 70 65 3e 22 2c 20 73 | 65 6c 66 2e 63 61 6e 63 |ape>", s|elf.canc|
|00000af0| 65 6c 29 0d 20 20 20 20 | 20 20 73 65 6c 66 2e 62 |el). | self.b|
|00000b00| 69 6e 64 28 22 3c 42 75 | 74 74 6f 6e 2d 31 3e 22 |ind("<Bu|tton-1>"|
|00000b10| 2c 20 73 65 6c 66 2e 6d | 6f 75 73 65 4c 6f 63 43 |, self.m|ouseLocC|
|00000b20| 6d 64 29 0d 20 20 20 20 | 20 20 62 6f 78 2e 70 61 |md). | box.pa|
|00000b30| 63 6b 28 70 61 64 78 3d | 30 2c 20 70 61 64 79 3d |ck(padx=|0, pady=|
|00000b40| 30 2c 20 73 69 64 65 3d | 54 4f 50 2c 20 66 69 6c |0, side=|TOP, fil|
|00000b50| 6c 3d 42 4f 54 48 29 0d | 0d 20 20 20 20 20 20 23 |l=BOTH).|. #|
|00000b60| 62 6f 78 20 3d 20 46 72 | 61 6d 65 28 73 65 6c 66 |box = Fr|ame(self|
|00000b70| 2c 20 62 67 3d 43 4f 4c | 4f 52 62 67 32 2c 20 62 |, bg=COL|ORbg2, b|
|00000b80| 64 3d 30 29 0d 20 20 20 | 20 20 20 23 64 69 76 5f |d=0). | #div_|
|00000b90| 72 6f 77 20 3d 20 46 72 | 61 6d 65 28 62 6f 78 2c |row = Fr|ame(box,|
|00000ba0| 20 62 67 3d 43 4f 4c 4f | 52 62 67 31 29 0d 20 20 | bg=COLO|Rbg1). |
|00000bb0| 20 20 20 20 23 61 74 68 | 65 6e 61 54 4b 2e 42 6c | #ath|enaTK.Bl|
|00000bc0| 61 6e 6b 46 72 61 6d 65 | 28 64 69 76 5f 72 6f 77 |ankFrame|(div_row|
|00000bd0| 29 20 20 23 67 72 61 79 | 0d 20 20 20 20 20 20 23 |) #gray|. #|
|00000be0| 64 69 76 5f 72 6f 77 2e | 70 61 63 6b 28 73 69 64 |div_row.|pack(sid|
|00000bf0| 65 3d 54 4f 50 2c 20 65 | 78 70 61 6e 64 3d 31 2c |e=TOP, e|xpand=1,|
|00000c00| 20 66 69 6c 6c 3d 42 4f | 54 48 29 20 0d 0d 20 20 | fill=BO|TH) .. |
|00000c10| 20 20 20 20 23 64 69 76 | 5f 72 6f 77 20 3d 20 46 | #div|_row = F|
|00000c20| 72 61 6d 65 28 62 6f 78 | 2c 20 62 67 3d 43 4f 4c |rame(box|, bg=COL|
|00000c30| 4f 52 62 67 31 29 0d 20 | 20 20 20 20 20 23 61 74 |ORbg1). | #at|
|00000c40| 68 65 6e 61 54 4b 2e 42 | 6c 61 6e 6b 46 72 61 6d |henaTK.B|lankFram|
|00000c50| 65 32 28 64 69 76 5f 72 | 6f 77 29 20 20 23 62 6c |e2(div_r|ow) #bl|
|00000c60| 61 63 6b 0d 20 20 20 20 | 20 20 23 64 69 76 5f 72 |ack. | #div_r|
|00000c70| 6f 77 2e 70 61 63 6b 28 | 73 69 64 65 3d 54 4f 50 |ow.pack(|side=TOP|
|00000c80| 2c 20 65 78 70 61 6e 64 | 3d 31 2c 20 66 69 6c 6c |, expand|=1, fill|
|00000c90| 3d 42 4f 54 48 29 0d 0d | 20 20 20 20 20 20 23 62 |=BOTH)..| #b|
|00000ca0| 6f 78 2e 70 61 63 6b 28 | 70 61 64 78 3d 30 2c 20 |ox.pack(|padx=0, |
|00000cb0| 70 61 64 79 3d 30 2c 20 | 73 69 64 65 3d 54 4f 50 |pady=0, |side=TOP|
|00000cc0| 2c 20 66 69 6c 6c 3d 42 | 4f 54 48 29 0d 0d 0d 20 |, fill=B|OTH)... |
|00000cd0| 20 20 64 65 66 20 6f 6b | 28 73 65 6c 66 2c 20 65 | def ok|(self, e|
|00000ce0| 76 65 6e 74 3d 4e 6f 6e | 65 29 3a 0d 20 20 20 20 |vent=Non|e):. |
|00000cf0| 20 20 69 66 20 6e 6f 74 | 20 73 65 6c 66 2e 76 61 | if not| self.va|
|00000d00| 6c 69 64 61 74 65 28 29 | 3a 0d 20 20 20 20 20 20 |lidate()|:. |
|00000d10| 20 20 20 73 65 6c 66 2e | 69 6e 69 74 69 61 6c 5f | self.|initial_|
|00000d20| 66 6f 63 75 73 2e 66 6f | 63 75 73 5f 73 65 74 28 |focus.fo|cus_set(|
|00000d30| 29 20 23 20 70 75 74 20 | 66 6f 63 75 73 20 62 61 |) # put |focus ba|
|00000d40| 63 6b 0d 20 20 20 20 20 | 20 20 20 20 72 65 74 75 |ck. | retu|
|00000d50| 72 6e 0d 20 20 20 20 20 | 20 73 65 6c 66 2e 77 69 |rn. | self.wi|
|00000d60| 74 68 64 72 61 77 28 29 | 0d 20 20 20 20 20 20 73 |thdraw()|. s|
|00000d70| 65 6c 66 2e 76 61 6c 69 | 64 61 74 65 28 29 0d 20 |elf.vali|date(). |
|00000d80| 20 20 20 20 20 73 65 6c | 66 2e 75 70 64 61 74 65 | sel|f.update|
|00000d90| 5f 69 64 6c 65 74 61 73 | 6b 73 28 29 0d 20 20 20 |_idletas|ks(). |
|00000da0| 20 20 20 69 66 20 73 65 | 6c 66 2e 72 65 73 75 6c | if se|lf.resul|
|00000db0| 74 20 3d 3d 20 27 27 20 | 6f 72 20 73 65 6c 66 2e |t == '' |or self.|
|00000dc0| 72 65 73 75 6c 74 20 3d | 3d 20 4e 6f 6e 65 3a 0d |result =|= None:.|
|00000dd0| 20 20 20 20 20 20 20 20 | 20 73 65 6c 66 2e 72 65 | | self.re|
|00000de0| 73 75 6c 74 20 3d 3d 20 | 27 31 27 20 23 20 61 63 |sult == |'1' # ac|
|00000df0| 63 65 70 74 0d 20 20 20 | 20 20 20 69 66 20 73 65 |cept. | if se|
|00000e00| 6c 66 2e 72 65 73 75 6c | 74 2e 73 74 72 69 70 28 |lf.resul|t.strip(|
|00000e10| 29 20 3d 3d 20 27 5c 6e | 27 20 6f 72 20 73 65 6c |) == '\n|' or sel|
|00000e20| 66 2e 72 65 73 75 6c 74 | 2e 73 74 72 69 70 28 29 |f.result|.strip()|
|00000e30| 20 3d 3d 20 27 5c 6e 5c | 6e 27 20 6f 72 20 73 65 | == '\n\|n' or se|
|00000e40| 6c 66 2e 72 65 73 75 6c | 74 2e 73 74 72 69 70 28 |lf.resul|t.strip(|
|00000e50| 29 20 3d 3d 20 27 5c 6e | 5c 6e 5c 6e 27 3a 0d 20 |) == '\n|\n\n':. |
|00000e60| 20 20 20 20 20 20 20 20 | 73 65 6c 66 2e 72 65 73 | |self.res|
|00000e70| 75 6c 74 20 3d 3d 20 27 | 31 27 20 23 20 61 63 63 |ult == '|1' # acc|
|00000e80| 65 70 74 0d 20 20 20 20 | 20 20 73 65 6c 66 2e 64 |ept. | self.d|
|00000e90| 65 73 74 72 6f 79 28 29 | 0d 0d 20 20 20 64 65 66 |estroy()|.. def|
|00000ea0| 20 63 61 6e 63 65 6c 28 | 73 65 6c 66 2c 20 65 76 | cancel(|self, ev|
|00000eb0| 65 6e 74 3d 4e 6f 6e 65 | 29 3a 0d 20 20 20 20 20 |ent=None|):. |
|00000ec0| 20 23 20 70 75 74 20 66 | 6f 63 75 73 20 62 61 63 | # put f|ocus bac|
|00000ed0| 6b 20 74 6f 20 74 68 65 | 20 70 61 72 65 6e 74 20 |k to the| parent |
|00000ee0| 77 69 6e 64 6f 77 0d 20 | 20 20 20 20 20 69 66 20 |window. | if |
|00000ef0| 73 65 6c 66 2e 70 61 72 | 65 6e 74 20 69 73 20 6e |self.par|ent is n|
|00000f00| 6f 74 20 4e 6f 6e 65 3a | 0d 20 20 20 20 20 20 20 |ot None:|. |
|00000f10| 20 20 73 65 6c 66 2e 70 | 61 72 65 6e 74 2e 66 6f | self.p|arent.fo|
|00000f20| 63 75 73 5f 73 65 74 28 | 29 0d 20 20 20 20 20 20 |cus_set(|). |
|00000f30| 73 65 6c 66 2e 72 65 73 | 75 6c 74 20 3d 20 27 2d |self.res|ult = '-|
|00000f40| 31 27 0d 20 20 20 20 20 | 20 73 65 6c 66 2e 64 65 |1'. | self.de|
|00000f50| 73 74 72 6f 79 28 29 0d | 0d 20 20 20 64 65 66 20 |stroy().|. def |
|00000f60| 76 61 6c 69 64 61 74 65 | 28 73 65 6c 66 29 3a 0d |validate|(self):.|
|00000f70| 20 20 20 20 20 20 72 65 | 74 75 72 6e 20 31 20 23 | re|turn 1 #|
|00000f80| 20 6f 76 65 72 72 69 64 | 65 0d 20 20 20 64 65 66 | overrid|e. def|
|00000f90| 20 61 70 70 6c 79 28 73 | 65 6c 66 29 3a 0d 20 20 | apply(s|elf):. |
|00000fa0| 20 20 20 20 70 61 73 73 | 20 23 20 6f 76 65 72 72 | pass| # overr|
|00000fb0| 69 64 65 0d 0d 20 20 20 | 64 65 66 20 6d 6f 75 73 |ide.. |def mous|
|00000fc0| 65 4c 6f 63 43 6d 64 28 | 73 65 6c 66 2c 20 65 76 |eLocCmd(|self, ev|
|00000fd0| 65 6e 74 29 3a 0d 20 20 | 20 20 20 20 77 69 64 67 |ent):. | widg|
|00000fe0| 65 74 49 6e 73 74 61 6e | 63 65 20 3d 20 65 76 65 |etInstan|ce = eve|
|00000ff0| 6e 74 2e 77 69 64 67 65 | 74 0d 20 20 20 20 20 20 |nt.widge|t. |
|00001000| 74 72 79 3a 0d 20 20 20 | 20 20 20 20 20 20 74 65 |try:. | te|
|00001010| 78 74 43 6d 64 20 3d 20 | 77 69 64 67 65 74 49 6e |xtCmd = |widgetIn|
|00001020| 73 74 61 6e 63 65 2e 74 | 65 78 74 53 74 72 69 6e |stance.t|extStrin|
|00001030| 67 0d 20 20 20 20 20 20 | 65 78 63 65 70 74 3a 0d |g. |except:.|
|00001040| 20 20 20 20 20 20 20 20 | 20 74 65 78 74 43 6d 64 | | textCmd|
|00001050| 20 3d 20 27 27 0d 20 20 | 20 20 20 20 69 66 20 74 | = ''. | if t|
|00001060| 65 78 74 43 6d 64 20 3d | 3d 20 27 27 3a 0d 20 20 |extCmd =|= '':. |
|00001070| 20 20 20 20 20 20 20 70 | 61 73 73 0d 20 20 20 20 | p|ass. |
|00001080| 20 20 65 6c 69 66 20 74 | 65 78 74 43 6d 64 20 3d | elif t|extCmd =|
|00001090| 3d 20 27 6f 6b 27 20 6f | 72 20 74 65 78 74 43 6d |= 'ok' o|r textCm|
|000010a0| 64 20 3d 3d 20 27 63 61 | 6e 63 65 6c 27 3a 0d 20 |d == 'ca|ncel':. |
|000010b0| 20 20 20 20 20 20 20 20 | 65 76 61 6c 28 27 73 65 | |eval('se|
|000010c0| 6c 66 2e 27 2b 74 65 78 | 74 43 6d 64 2b 27 28 29 |lf.'+tex|tCmd+'()|
|000010d0| 27 29 20 23 20 63 61 6c | 6c 20 61 63 74 69 6f 6e |') # cal|l action|
|000010e0| 20 61 74 20 74 68 69 73 | 20 6d 6f 75 73 65 20 63 | at this| mouse c|
|000010f0| 6c 69 63 6b 0d 20 20 20 | 20 20 20 65 6c 73 65 3a |lick. | else:|
|00001100| 0d 20 20 20 20 20 20 20 | 20 20 70 61 73 73 0d 0d |. | pass..|
|00001110| 63 6c 61 73 73 20 5f 51 | 75 65 72 79 44 69 61 6c |class _Q|ueryDial|
|00001120| 6f 67 28 44 69 61 6c 6f | 67 29 3a 0d 20 20 20 64 |og(Dialo|g):. d|
|00001130| 65 66 20 5f 5f 69 6e 69 | 74 5f 5f 28 73 65 6c 66 |ef __ini|t__(self|
|00001140| 2c 20 74 69 74 6c 65 2c | 20 70 72 6f 6d 70 74 2c |, title,| prompt,|
|00001150| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 69 6e |. | in|
|00001160| 69 74 69 61 6c 76 61 6c | 75 65 3d 4e 6f 6e 65 2c |itialval|ue=None,|
|00001170| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 6d 69 |. | mi|
|00001180| 6e 76 61 6c 75 65 20 3d | 20 4e 6f 6e 65 2c 20 6d |nvalue =| None, m|
|00001190| 61 78 76 61 6c 75 65 20 | 3d 20 4e 6f 6e 65 2c 0d |axvalue |= None,.|
|000011a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 70 61 72 | | par|
|000011b0| 65 6e 74 20 3d 20 4e 6f | 6e 65 29 3a 0d 20 20 20 |ent = No|ne):. |
|000011c0| 20 20 20 69 66 20 6e 6f | 74 20 70 61 72 65 6e 74 | if no|t parent|
|000011d0| 3a 0d 20 20 20 20 20 20 | 20 20 20 69 6d 70 6f 72 |:. | impor|
|000011e0| 74 20 54 6b 69 6e 74 65 | 72 0d 20 20 20 20 20 20 |t Tkinte|r. |
|000011f0| 20 20 20 70 61 72 65 6e | 74 20 3d 20 54 6b 69 6e | paren|t = Tkin|
|00001200| 74 65 72 2e 5f 64 65 66 | 61 75 6c 74 5f 72 6f 6f |ter._def|ault_roo|
|00001210| 74 0d 20 20 20 20 20 20 | 20 20 20 23 70 61 72 65 |t. | #pare|
|00001220| 6e 74 2e 77 69 74 68 64 | 72 61 77 28 29 20 68 69 |nt.withd|raw() hi|
|00001230| 64 65 73 20 70 61 72 65 | 6e 74 0d 20 20 20 20 20 |des pare|nt. |
|00001240| 20 73 65 6c 66 2e 70 72 | 6f 6d 70 74 20 20 20 3d | self.pr|ompt =|
|00001250| 20 70 72 6f 6d 70 74 0d | 20 20 20 20 20 20 44 69 | prompt.| Di|
|00001260| 61 6c 6f 67 2e 5f 5f 69 | 6e 69 74 5f 5f 28 73 65 |alog.__i|nit__(se|
|00001270| 6c 66 2c 20 70 61 72 65 | 6e 74 2c 20 74 69 74 6c |lf, pare|nt, titl|
|00001280| 65 29 0d 0d 20 20 20 64 | 65 66 20 64 65 73 74 72 |e).. d|ef destr|
|00001290| 6f 79 28 73 65 6c 66 29 | 3a 0d 20 20 20 20 20 20 |oy(self)|:. |
|000012a0| 73 65 6c 66 2e 65 6e 74 | 72 79 20 3d 20 4e 6f 6e |self.ent|ry = Non|
|000012b0| 65 0d 20 20 20 20 20 20 | 44 69 61 6c 6f 67 2e 64 |e. |Dialog.d|
|000012c0| 65 73 74 72 6f 79 28 73 | 65 6c 66 29 0d 0d 20 20 |estroy(s|elf).. |
|000012d0| 20 64 65 66 20 62 6f 64 | 79 28 73 65 6c 66 2c 20 | def bod|y(self, |
|000012e0| 6d 61 73 74 65 72 29 3a | 0d 20 20 20 20 20 20 23 |master):|. #|
|000012f0| 77 20 3d 20 4c 61 62 65 | 6c 28 73 65 6c 66 2c 20 |w = Labe|l(self, |
|00001300| 74 65 78 74 3d 73 65 6c | 66 2e 70 72 6f 6d 70 74 |text=sel|f.prompt|
|00001310| 2c 20 66 67 3d 43 4f 4c | 4f 52 74 78 32 2c 20 68 |, fg=COL|ORtx2, h|
|00001320| 65 69 67 68 74 3d 34 2c | 20 70 61 64 79 3d 30 2c |eight=4,| pady=0,|
|00001330| 0d 20 20 20 20 20 20 23 | 20 20 20 20 20 20 66 6f |. #| fo|
|00001340| 6e 74 3d 66 6f 6e 74 54 | 69 74 6c 65 2c 20 62 67 |nt=fontT|itle, bg|
|00001350| 3d 43 4f 4c 4f 52 62 67 | 34 29 0d 0d 20 20 20 20 |=COLORbg|4).. |
|00001360| 20 20 23 77 20 3d 20 61 | 74 68 65 6e 61 54 4b 2e | #w = a|thenaTK.|
|00001370| 41 78 4c 61 62 65 6c 28 | 6d 61 73 74 65 72 2c 20 |AxLabel(|master, |
|00001380| 73 65 6c 66 2e 70 72 6f | 6d 70 74 2c 20 27 27 2c |self.pro|mpt, '',|
|00001390| 20 34 29 0d 20 20 20 20 | 20 20 23 77 2e 67 72 69 | 4). | #w.gri|
|000013a0| 64 28 72 6f 77 3d 30 2c | 20 70 61 64 78 3d 30 2c |d(row=0,| padx=0,|
|000013b0| 20 73 74 69 63 6b 79 3d | 57 29 0d 20 20 20 20 20 | sticky=|W). |
|000013c0| 20 23 77 2e 70 61 63 6b | 28 70 61 64 78 3d 30 2c | #w.pack|(padx=0,|
|000013d0| 20 70 61 64 79 3d 30 2c | 20 73 69 64 65 3d 54 4f | pady=0,| side=TO|
|000013e0| 50 2c 20 66 69 6c 6c 3d | 42 4f 54 48 2c 20 65 78 |P, fill=|BOTH, ex|
|000013f0| 70 61 6e 64 3d 31 29 0d | 20 0d 20 20 20 20 20 20 |pand=1).| . |
|00001400| 73 65 6c 66 2e 64 69 73 | 70 6c 61 79 20 3d 20 20 |self.dis|play = |
|00001410| 54 65 78 74 28 6d 61 73 | 74 65 72 2c 20 20 0d 20 |Text(mas|ter, . |
|00001420| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001430| 20 20 20 20 20 62 67 20 | 3d 20 43 4f 4c 4f 52 62 | bg |= COLORb|
|00001440| 67 31 2c 20 66 67 20 3d | 20 43 4f 4c 4f 52 74 78 |g1, fg =| COLORtx|
|00001450| 31 2c 20 66 6f 6e 74 20 | 3d 20 66 6f 6e 74 54 65 |1, font |= fontTe|
|00001460| 78 74 2c 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |xt,. | |
|00001470| 20 20 20 20 20 20 20 20 | 20 20 68 65 69 67 68 74 | | height|
|00001480| 3d 33 2c 20 77 69 64 74 | 68 3d 35 30 2c 20 62 64 |=3, widt|h=50, bd|
|00001490| 3d 30 2c 20 70 61 64 78 | 3d 35 2c 20 70 61 64 79 |=0, padx|=5, pady|
|000014a0| 3d 30 2c 20 72 65 6c 69 | 65 66 3d 52 49 44 47 45 |=0, reli|ef=RIDGE|
|000014b0| 2c 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |,. | |
|000014c0| 20 20 20 20 20 20 20 20 | 73 65 6c 65 63 74 62 61 | |selectba|
|000014d0| 63 6b 67 72 6f 75 6e 64 | 3d 27 23 35 35 35 35 35 |ckground|='#55555|
|000014e0| 35 27 2c 20 73 65 6c 65 | 63 74 66 6f 72 65 67 72 |5', sele|ctforegr|
|000014f0| 6f 75 6e 64 3d 27 23 37 | 30 37 30 37 30 27 2c 0d |ound='#7|07070',.|
|00001500| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001510| 20 20 20 20 20 20 73 65 | 6c 65 63 74 62 6f 72 64 | se|lectbord|
|00001520| 65 72 77 69 64 74 68 20 | 3d 20 30 2c 20 0d 20 20 |erwidth |= 0, . |
|00001530| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001540| 20 20 20 20 68 69 67 68 | 6c 69 67 68 74 62 61 63 | high|lightbac|
|00001550| 6b 67 72 6f 75 6e 64 3d | 27 23 37 37 37 37 37 37 |kground=|'#777777|
|00001560| 27 2c 20 68 69 67 68 6c | 69 67 68 74 63 6f 6c 6f |', highl|ightcolo|
|00001570| 72 3d 27 23 35 35 35 35 | 35 35 27 2c 20 0d 20 20 |r='#5555|55', . |
|00001580| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001590| 20 20 20 20 68 69 67 68 | 6c 69 67 68 74 74 68 69 | high|lightthi|
|000015a0| 63 6b 6e 65 73 73 20 3d | 20 30 2c 29 0d 20 20 20 |ckness =| 0,). |
|000015b0| 20 20 20 73 65 6c 66 2e | 64 69 73 70 6c 61 79 2e | self.|display.|
|000015c0| 70 61 63 6b 28 73 69 64 | 65 3d 54 4f 50 2c 20 65 |pack(sid|e=TOP, e|
|000015d0| 78 70 61 6e 64 3d 31 2c | 20 66 69 6c 6c 3d 42 4f |xpand=1,| fill=BO|
|000015e0| 54 48 29 20 20 20 23 4c | 45 46 54 2c 20 65 78 70 |TH) #L|EFT, exp|
|000015f0| 61 6e 64 3d 30 0d 20 20 | 20 20 20 20 73 65 6c 66 |and=0. | self|
|00001600| 2e 64 69 73 70 6c 61 79 | 2e 63 6f 6e 66 69 67 75 |.display|.configu|
|00001610| 72 65 28 77 72 61 70 20 | 3d 20 27 77 6f 72 64 27 |re(wrap |= 'word'|
|00001620| 29 0d 20 20 20 20 20 20 | 73 65 6c 66 2e 64 69 73 |). |self.dis|
|00001630| 70 6c 61 79 2e 69 6e 73 | 65 72 74 28 49 4e 53 45 |play.ins|ert(INSE|
|00001640| 52 54 2c 20 73 65 6c 66 | 2e 70 72 6f 6d 70 74 29 |RT, self|.prompt)|
|00001650| 0d 20 20 20 20 20 20 73 | 65 6c 66 2e 64 69 73 70 |. s|elf.disp|
|00001660| 6c 61 79 2e 63 6f 6e 66 | 69 67 75 72 65 28 73 74 |lay.conf|igure(st|
|00001670| 61 74 65 20 3d 20 44 49 | 53 41 42 4c 45 44 29 20 |ate = DI|SABLED) |
|00001680| 23 20 63 61 6e 74 20 64 | 65 6c 65 74 65 20 74 68 |# cant d|elete th|
|00001690| 69 73 20 74 65 78 74 21 | 0d 0d 20 20 20 20 20 20 |is text!|.. |
|000016a0| 23 73 65 6c 66 2e 64 69 | 73 70 6c 61 79 2e 73 65 |#self.di|splay.se|
|000016b0| 65 28 45 4e 44 29 0d 0d | 20 20 20 20 20 20 73 65 |e(END)..| se|
|000016c0| 6c 66 2e 65 6e 74 72 79 | 20 3d 20 20 54 65 78 74 |lf.entry| = Text|
|000016d0| 28 6d 61 73 74 65 72 2c | 20 20 0d 20 20 20 20 20 |(master,| . |
|000016e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000016f0| 20 62 67 20 3d 20 27 23 | 30 30 30 30 30 30 27 2c | bg = '#|000000',|
|00001700| 20 66 67 20 3d 20 43 4f | 4c 4f 52 74 78 32 2c 20 | fg = CO|LORtx2, |
|00001710| 66 6f 6e 74 20 3d 20 66 | 6f 6e 74 54 65 78 74 2c |font = f|ontText,|
|00001720| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00001730| 20 20 20 20 20 20 20 68 | 65 69 67 68 74 3d 32 2c | h|eight=2,|
|00001740| 20 77 69 64 74 68 3d 35 | 30 2c 20 62 64 3d 30 2c | width=5|0, bd=0,|
|00001750| 20 70 61 64 78 3d 35 2c | 20 70 61 64 79 3d 30 2c | padx=5,| pady=0,|
|00001760| 20 72 65 6c 69 65 66 3d | 52 49 44 47 45 2c 0d 20 | relief=|RIDGE,. |
|00001770| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001780| 20 20 20 20 20 73 65 6c | 65 63 74 62 61 63 6b 67 | sel|ectbackg|
|00001790| 72 6f 75 6e 64 3d 27 23 | 35 35 35 35 35 35 27 2c |round='#|555555',|
|000017a0| 20 73 65 6c 65 63 74 66 | 6f 72 65 67 72 6f 75 6e | selectf|oregroun|
|000017b0| 64 3d 27 23 37 30 37 30 | 37 30 27 2c 0d 20 20 20 |d='#7070|70',. |
|000017c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000017d0| 20 20 20 73 65 6c 65 63 | 74 62 6f 72 64 65 72 77 | selec|tborderw|
|000017e0| 69 64 74 68 20 3d 20 30 | 2c 20 0d 20 20 20 20 20 |idth = 0|, . |
|000017f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001800| 20 68 69 67 68 6c 69 67 | 68 74 62 61 63 6b 67 72 | highlig|htbackgr|
|00001810| 6f 75 6e 64 3d 27 23 37 | 37 37 37 37 37 27 2c 20 |ound='#7|77777', |
|00001820| 68 69 67 68 6c 69 67 68 | 74 63 6f 6c 6f 72 3d 27 |highligh|tcolor='|
|00001830| 23 35 35 35 35 35 35 27 | 2c 20 0d 20 20 20 20 20 |#555555'|, . |
|00001840| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001850| 20 68 69 67 68 6c 69 67 | 68 74 74 68 69 63 6b 6e | highlig|htthickn|
|00001860| 65 73 73 20 3d 20 30 2c | 29 0d 20 20 20 20 20 20 |ess = 0,|). |
|00001870| 73 65 6c 66 2e 65 6e 74 | 72 79 2e 70 61 63 6b 28 |self.ent|ry.pack(|
|00001880| 73 69 64 65 3d 54 4f 50 | 2c 20 65 78 70 61 6e 64 |side=TOP|, expand|
|00001890| 3d 31 2c 20 66 69 6c 6c | 3d 42 4f 54 48 29 20 20 |=1, fill|=BOTH) |
|000018a0| 20 23 4c 45 46 54 2c 20 | 65 78 70 61 6e 64 3d 30 | #LEFT, |expand=0|
|000018b0| 0d 20 20 20 20 20 20 73 | 65 6c 66 2e 65 6e 74 72 |. s|elf.entr|
|000018c0| 79 2e 63 6f 6e 66 69 67 | 75 72 65 28 77 72 61 70 |y.config|ure(wrap|
|000018d0| 20 3d 20 27 77 6f 72 64 | 27 29 0d 0d 20 20 20 20 | = 'word|').. |
|000018e0| 20 20 23 73 65 6c 66 2e | 65 6e 74 72 79 20 3d 20 | #self.|entry = |
|000018f0| 45 6e 74 72 79 28 6d 61 | 73 74 65 72 2c 20 6e 61 |Entry(ma|ster, na|
|00001900| 6d 65 3d 22 65 6e 74 72 | 79 22 2c 0d 20 20 20 20 |me="entr|y",. |
|00001910| 20 20 23 20 20 20 62 67 | 20 3d 20 27 23 30 30 30 | # bg| = '#000|
|00001920| 30 30 30 27 2c 20 66 67 | 20 3d 20 27 23 37 30 37 |000', fg| = '#707|
|00001930| 30 37 30 27 2c 20 66 6f | 6e 74 20 3d 20 66 6f 6e |070', fo|nt = fon|
|00001940| 74 54 65 78 74 2c 20 62 | 64 3d 30 2c 20 0d 20 20 |tText, b|d=0, . |
|00001950| 20 20 20 20 23 20 20 20 | 72 65 6c 69 65 66 3d 52 | # |relief=R|
|00001960| 49 44 47 45 2c 20 73 65 | 6c 65 63 74 62 61 63 6b |IDGE, se|lectback|
|00001970| 67 72 6f 75 6e 64 3d 27 | 23 30 30 30 30 30 30 27 |ground='|#000000'|
|00001980| 2c 20 73 65 6c 65 63 74 | 66 6f 72 65 67 72 6f 75 |, select|foregrou|
|00001990| 6e 64 3d 27 23 37 30 37 | 30 37 30 27 2c 0d 20 20 |nd='#707|070',. |
|000019a0| 20 20 20 20 23 20 20 20 | 73 65 6c 65 63 74 62 6f | # |selectbo|
|000019b0| 72 64 65 72 77 69 64 74 | 68 20 3d 20 31 2c 20 68 |rderwidt|h = 1, h|
|000019c0| 69 67 68 6c 69 67 68 74 | 62 61 63 6b 67 72 6f 75 |ighlight|backgrou|
|000019d0| 6e 64 3d 27 23 35 35 35 | 35 35 35 27 2c 20 68 69 |nd='#555|555', hi|
|000019e0| 67 68 6c 69 67 68 74 63 | 6f 6c 6f 72 3d 27 23 35 |ghlightc|olor='#5|
|000019f0| 35 35 35 35 35 27 2c 20 | 0d 20 20 20 20 20 20 23 |55555', |. #|
|00001a00| 20 20 20 68 69 67 68 6c | 69 67 68 74 74 68 69 63 | highl|ightthic|
|00001a10| 6b 6e 65 73 73 20 3d 20 | 30 29 0d 20 20 20 20 20 |kness = |0). |
|00001a20| 20 23 73 65 6c 66 2e 65 | 6e 74 72 79 2e 67 72 69 | #self.e|ntry.gri|
|00001a30| 64 28 72 6f 77 3d 31 2c | 20 70 61 64 78 3d 30 2c |d(row=1,| padx=0,|
|00001a40| 20 73 74 69 63 6b 79 3d | 57 2b 45 29 0d 20 20 20 | sticky=|W+E). |
|00001a50| 20 20 20 73 65 6c 66 2e | 65 6e 74 72 79 2e 70 61 | self.|entry.pa|
|00001a60| 63 6b 28 70 61 64 78 3d | 30 2c 20 70 61 64 79 3d |ck(padx=|0, pady=|
|00001a70| 30 2c 20 73 69 64 65 3d | 54 4f 50 2c 20 66 69 6c |0, side=|TOP, fil|
|00001a80| 6c 3d 42 4f 54 48 2c 20 | 65 78 70 61 6e 64 3d 31 |l=BOTH, |expand=1|
|00001a90| 29 0d 20 20 20 20 20 20 | 72 65 74 75 72 6e 20 73 |). |return s|
|00001aa0| 65 6c 66 2e 65 6e 74 72 | 79 0d 0d 20 20 20 64 65 |elf.entr|y.. de|
|00001ab0| 66 20 76 61 6c 69 64 61 | 74 65 28 73 65 6c 66 29 |f valida|te(self)|
|00001ac0| 3a 0d 20 20 20 20 20 20 | 74 72 79 3a 0d 20 20 20 |:. |try:. |
|00001ad0| 20 20 20 20 20 20 72 65 | 73 75 6c 74 20 3d 20 73 | re|sult = s|
|00001ae0| 65 6c 66 2e 67 65 74 72 | 65 73 75 6c 74 28 29 0d |elf.getr|esult().|
|00001af0| 20 20 20 20 20 20 65 78 | 63 65 70 74 20 56 61 6c | ex|cept Val|
|00001b00| 75 65 45 72 72 6f 72 3a | 0d 20 20 20 20 20 20 20 |ueError:|. |
|00001b10| 20 20 72 65 73 75 6c 74 | 20 3d 20 27 65 72 72 6f | result| = 'erro|
|00001b20| 72 27 0d 20 20 20 20 20 | 20 73 65 6c 66 2e 72 65 |r'. | self.re|
|00001b30| 73 75 6c 74 20 3d 20 72 | 65 73 75 6c 74 0d 20 20 |sult = r|esult. |
|00001b40| 20 20 20 20 72 65 74 75 | 72 6e 20 31 0d 0d 63 6c | retu|rn 1..cl|
|00001b50| 61 73 73 20 5f 51 75 65 | 72 79 53 74 72 69 6e 67 |ass _Que|ryString|
|00001b60| 28 5f 51 75 65 72 79 44 | 69 61 6c 6f 67 29 3a 0d |(_QueryD|ialog):.|
|00001b70| 20 20 20 64 65 66 20 5f | 5f 69 6e 69 74 5f 5f 28 | def _|_init__(|
|00001b80| 73 65 6c 66 2c 20 2a 61 | 72 67 73 2c 20 2a 2a 6b |self, *a|rgs, **k|
|00001b90| 77 29 3a 0d 20 20 20 20 | 20 20 69 66 20 6b 77 2e |w):. | if kw.|
|00001ba0| 68 61 73 5f 6b 65 79 28 | 22 73 68 6f 77 22 29 3a |has_key(|"show"):|
|00001bb0| 0d 20 20 20 20 20 20 20 | 20 20 73 65 6c 66 2e 5f |. | self._|
|00001bc0| 5f 73 68 6f 77 20 3d 20 | 6b 77 5b 22 73 68 6f 77 |_show = |kw["show|
|00001bd0| 22 5d 0d 20 20 20 20 20 | 20 20 20 20 64 65 6c 20 |"]. | del |
|00001be0| 6b 77 5b 22 73 68 6f 77 | 22 5d 0d 20 20 20 20 20 |kw["show|"]. |
|00001bf0| 20 65 6c 73 65 3a 0d 20 | 20 20 20 20 20 20 20 20 | else:. | |
|00001c00| 73 65 6c 66 2e 5f 5f 73 | 68 6f 77 20 3d 20 4e 6f |self.__s|how = No|
|00001c10| 6e 65 0d 20 20 20 20 20 | 20 5f 51 75 65 72 79 44 |ne. | _QueryD|
|00001c20| 69 61 6c 6f 67 2e 5f 5f | 69 6e 69 74 5f 5f 28 73 |ialog.__|init__(s|
|00001c30| 65 6c 66 2c 20 2a 61 72 | 67 73 2c 20 2a 2a 6b 77 |elf, *ar|gs, **kw|
|00001c40| 29 0d 20 20 20 64 65 66 | 20 62 6f 64 79 28 73 65 |). def| body(se|
|00001c50| 6c 66 2c 20 6d 61 73 74 | 65 72 29 3a 0d 20 20 20 |lf, mast|er):. |
|00001c60| 20 20 20 65 6e 74 72 79 | 20 3d 20 5f 51 75 65 72 | entry| = _Quer|
|00001c70| 79 44 69 61 6c 6f 67 2e | 62 6f 64 79 28 73 65 6c |yDialog.|body(sel|
|00001c80| 66 2c 20 6d 61 73 74 65 | 72 29 0d 20 20 20 20 20 |f, maste|r). |
|00001c90| 20 69 66 20 73 65 6c 66 | 2e 5f 5f 73 68 6f 77 20 | if self|.__show |
|00001ca0| 69 73 20 6e 6f 74 20 4e | 6f 6e 65 3a 0d 20 20 20 |is not N|one:. |
|00001cb0| 20 20 20 20 20 20 65 6e | 74 72 79 2e 63 6f 6e 66 | en|try.conf|
|00001cc0| 69 67 75 72 65 28 73 68 | 6f 77 3d 73 65 6c 66 2e |igure(sh|ow=self.|
|00001cd0| 5f 5f 73 68 6f 77 29 0d | 20 20 20 20 20 20 72 65 |__show).| re|
|00001ce0| 74 75 72 6e 20 65 6e 74 | 72 79 0d 20 20 20 64 65 |turn ent|ry. de|
|00001cf0| 66 20 67 65 74 72 65 73 | 75 6c 74 28 73 65 6c 66 |f getres|ult(self|
|00001d00| 29 3a 0d 20 20 20 20 20 | 20 72 65 74 75 72 6e 20 |):. | return |
|00001d10| 73 65 6c 66 2e 65 6e 74 | 72 79 2e 67 65 74 28 31 |self.ent|ry.get(1|
|00001d20| 2e 30 2c 20 49 4e 53 45 | 52 54 29 0d 0d 0d 64 65 |.0, INSE|RT)...de|
|00001d30| 66 20 61 73 6b 73 74 72 | 69 6e 67 28 74 69 74 6c |f askstr|ing(titl|
|00001d40| 65 2c 20 70 72 6f 6d 70 | 74 2c 20 2a 2a 6b 77 29 |e, promp|t, **kw)|
|00001d50| 3a 0d 20 20 20 20 27 27 | 27 67 65 74 20 61 20 73 |:. ''|'get a s|
|00001d60| 74 72 69 6e 67 20 66 72 | 6f 6d 20 74 68 65 20 75 |tring fr|om the u|
|00001d70| 73 65 72 0d 20 20 20 20 | 41 72 67 75 6d 65 6e 74 |ser. |Argument|
|00001d80| 73 0d 20 20 20 20 20 20 | 20 20 74 69 74 6c 65 20 |s. | title |
|00001d90| 2d 2d 20 74 68 65 20 64 | 69 61 6c 6f 67 20 74 69 |-- the d|ialog ti|
|00001da0| 74 6c 65 0d 20 20 20 20 | 20 20 20 20 70 72 6f 6d |tle. | prom|
|00001db0| 70 74 20 2d 2d 20 74 68 | 65 20 6c 61 62 65 6c 20 |pt -- th|e label |
|00001dc0| 74 65 78 74 0d 20 20 20 | 20 20 20 20 20 2a 2a 6b |text. | **k|
|00001dd0| 77 20 2d 2d 20 73 65 65 | 20 53 69 6d 70 6c 65 44 |w -- see| SimpleD|
|00001de0| 69 61 6c 6f 67 20 63 6c | 61 73 73 0d 20 20 20 20 |ialog cl|ass. |
|00001df0| 52 65 74 75 72 6e 20 76 | 61 6c 75 65 20 69 73 20 |Return v|alue is |
|00001e00| 61 20 73 74 72 69 6e 67 | 0d 20 20 20 20 27 27 27 |a string|. '''|
|00001e10| 0d 20 20 20 20 64 20 3d | 20 61 70 70 6c 79 28 5f |. d =| apply(_|
|00001e20| 51 75 65 72 79 53 74 72 | 69 6e 67 2c 20 28 74 69 |QueryStr|ing, (ti|
|00001e30| 74 6c 65 2c 20 70 72 6f | 6d 70 74 29 2c 20 6b 77 |tle, pro|mpt), kw|
|00001e40| 29 0d 20 20 20 20 72 65 | 74 75 72 6e 20 64 2e 72 |). re|turn d.r|
|00001e50| 65 73 75 6c 74 0d 0d 0d | 0d 00 00 00 00 00 00 00 |esult...|........|
|00001e60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e80| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........|
|00001e90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ea0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001eb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f90| 00 00 00 00 00 00 00 00 | 00 1c 00 1e ff ff 00 00 |........|........|
|00001fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+